home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PCMania 21
/
PCMania CD21.nrg
/
pcmania
/
raton
/
sinfo.c
< prev
next >
Wrap
C/C++ Source or Header
|
1994-02-28
|
2KB
|
86 lines
#include <stdio.h>
#include <conio.h>
void main(void);
void chkcom(void);
void prttit(void);
void prtports(void);
int com1,com2,com3,com4;
void main(void)
{
chkcom();
prttit();
prtports();
}
void prtports(void)
{
int x,v;
textbackground(BLUE); textcolor(YELLOW);
for (x=9;x<13;x++) { gotoxy(23,x);
for (v=5;v<37;v++) { cprintf(" "); }
cprintf("\n");
}
gotoxy(22,8); cprintf("╔");
for (v=0;v<31;v++) { cprintf("═"); } cprintf("╗");
gotoxy(22,13); cprintf("╚");
for (v=0;v<31;v++) { cprintf("═"); } cprintf("╝");
for (v=1;v<5;v++) { gotoxy(22,v+8); cprintf("║"); }
for (v=1;v<5;v++) { gotoxy(54,v+8); cprintf("║"); }
gotoxy(23,9); textbackground(BLUE); textcolor(YELLOW);
cprintf("Puerto Serie COM1: "); textcolor(WHITE);
if (com1==0) cprintf("No instalado");
else cprintf("%04X",com1);
textcolor(YELLOW); gotoxy(23,10);
cprintf("Puerto Serie COM2: "); textcolor(WHITE);
if (com2==0) cprintf("No instalado");
else cprintf("%04X",com2);
textcolor(YELLOW); gotoxy(23,11);
cprintf("Puerto Serie COM3: "); textcolor(WHITE);
if (com3==0) cprintf("No instalado");
else cprintf("%04X",com3);
textcolor(YELLOW); gotoxy(23,12);
cprintf("Puerto Serie COM4: "); textcolor(WHITE);
if (com4==0) cprintf("No instalado");
else cprintf("%04X",com4);
textcolor(YELLOW);
}
void prttit(void)
{
clrscr();
window(20,1,60,6);
gotoxy(1,1);
textbackground(BLUE);
textcolor(YELLOW);
cprintf("╔═══════════════════════════════════════╗");
cprintf("║ SERIAL INFO ║");
cprintf("║ (C) Por Javier Guerrero Diaz ║");
cprintf("╚═══════════════════════════════════════╝");
window(1,1,80,25);
}
void chkcom(void)
{
asm push es
asm push di
asm mov ax,0040h
asm xor bx,bx
asm mov es,ax
asm mov di,bx
asm mov ax,es:[di]
asm mov com1,ax
asm mov ax,es:[di+2]
asm mov com2,ax
asm mov ax,es:[di+4]
asm mov com3,ax
asm mov ax,es:[di+6]
asm mov com4,ax
asm pop di
asm pop es
}